<script setup lang="ts">
// 类型
import type { rowss } from '@/types/types';
// vue
import { defineProps, defineEmits } from 'vue'
defineProps<{ item: rowss }>()
// 跳转页面
const emits = defineEmits()
const goTo = () => {
  emits('goTo')
}
</script>
<template>
  <div class="item" @click="goTo">
    <div class="item-left">
      <p class="title">
        {{ item.title }}
      </p>
      <div class="doctor-info">
        <img :src="item.creatorAvatar" alt="">
        <span class="doctor-name">{{ item.creatorName }}</span> <span>{{ item.creatorHospatalName }}</span>
      </div>
      <div class="topic">
        # {{ item.topic }}
      </div>
      <p class="shou">
        收藏{{ item.collectionNumber }}丨评论{{ item.commentNumber }}
      </p>
    </div>
    <img class="rightImg" :src="item.coverUrl[0]" alt="">
  </div>

</template>
<style scoped lang="scss">
.item {
  display: flex;
  justify-content: space-between;
  padding-bottom: 14px;

  .item-left {
    flex: 1;
    margin-right: 10px;

    .title {
      margin-top: 0;
      font-size: 14px;
      margin-bottom: 5px;
    }

    .doctor-info {
      display: flex;
      align-items: center;
      margin-bottom: 6px;

      .doctor-name {
        margin-right: 5px;
      }

      span {
        color: #c3c3c5;
        font-size: 12px;
      }

      img {
        width: 15px;
        height: 15px;
        border-radius: 50%;
        margin-right: 5px;
      }
    }

    .topic {
      margin-bottom: 6px;
      color: #16c2a3;
      font-size: 12px;
    }

    .shou {
      font-size: 12px;
      color: #c3c3c5;
      margin: 0;
    }
  }

  .rightImg {
    width: 105px;
    height: 68px;
    border-radius: 5px
  }
}
</style>
